import
request
from '../untils/request'

//请求banner数据
export const bannerGet = () => {
  return request.get("/classes/banner")
}

// 更新banner
export const bannerPut = (id, bannerObj) => {
  return request.put(`/classes/banner/${id}`, bannerObj);
};

//删除banner数据
export const bannerDel = (id) => {
  return request.delete(`/classes/banner/${id}`);
};

//后端筛选
export const backEnd = (condition = {}, order = 'originprice') => {
  return request.get(`classes/VueProduct`, {
    params: {
      limit: 10,
      where: condition, //自定义条件
      order //排序条件
    }
  })
}

//分页加载数据
export const getGoods = (page) => {
  return request.get('/classes/VueProduct', {
    params: {
      limit: 10,
      skip: 10 * (page - 1)
    }
  })
}